<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>16.优化方法借用</title>
</head>

<body>

</body>
  <script>
    //因为 Math.max 就是获取最大值的方法，所以代码可以再次优化
    let hd = {
      data: [1, 2, 3, 4, 5]
    };
    console.log(Math.max.apply(null, Object.values(hd.data)));

    let xj = {
      lessons: { js: 100, php: 78, node: 78, linux: 125 }
    };
    console.log(Math.max.apply(xj, Object.values(xj.lessons)));
  </script>
</html>